package Homework;

import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
/*作业：
抽奖箱1中了  800 100 1000 20 80 10 总额为
抽奖箱2中了  5 300 200 50 550 2 总额为
你们得把总和给我计算出来.

再加上，在此次抽奖过程中，抽奖箱1，产生了最大得金额，1000元
Callabled

搞100个抽奖箱.*/
public class work01 {
    public static void main(String[] args) throws Exception, Exception {
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list, 10, 5, 20, 50, 100, 200, 550, 800, 2, 80, 300, 1000);


        MyCallable mc = new MyCallable(list);
        ExecutorService service = Executors.newFixedThreadPool(100);

        for(int i=0;i<100;i++){
            service.submit(mc);
        }

        service.shutdown();
    }
}
